package ngames.com.sushitv.Fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

import ngames.com.sushitv.AppApplication;
import ngames.com.sushitv.R;
import ngames.com.sushitv.action.SearchPromptAction;
import ngames.com.sushitv.adapter.SearchPromptAdapter;
import ngames.com.sushitv.entity.SearchPrompt;
import ngames.com.sushitv.interfaces.TransmitSearchPrompt;

/**
 * A simple {@link Fragment} subclass.
 */
public class SearchPromptFragment extends Fragment implements TransmitSearchPrompt{
    private View view;
    private RecyclerView videosRecycler,userRecycler;
    private SearchPromptAdapter mAdapter,mAdapteruser;
    private SearchPromptAction searchPromptAction;
    @Override
    public void onResume() {
        super.onResume();

        //initView();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_search_prompt, container, false);
        searchPromptAction=new SearchPromptAction(getActivity(),view);
        searchPromptAction.onCreate();
        searchPromptAction.onRefreshData();
        //initView();
        return view;
    }

    private void initView() {
       /* videosRecycler= (RecyclerView) view.findViewById(R.id.recycler_search_videos);
        userRecycler= (RecyclerView) view.findViewById(R.id.recycler_search_users);
        videosRecycler.setHasFixedSize(true);
        //mRecycler.setLayoutManager(mLinearLayoutManager);
        videosRecycler.setLayoutManager(new GridLayoutManager(getContext(), 1));
        userRecycler.setHasFixedSize(true);
        //mRecycler.setLayoutManager(mLinearLayoutManager);
        userRecycler.setLayoutManager(new GridLayoutManager(getContext(), 1));

        SearchPrompt sp= AppApplication.getSearchPrompt();
        List<String> titles=sp.getTitle();
        List<String> users=sp.getUser();*/
       /* if(titles!=null) {
            mAdapter = new SearchPromptAdapter(getContext(), titles);
            videosRecycler.setAdapter(mAdapter);
        }
        if(users!=null) {
            mAdapteruser = new SearchPromptAdapter(getContext(), users);
            userRecycler.setAdapter(mAdapteruser);
        }*/
    }


    @Override
    public void transmitSearchPrompt(SearchPrompt searchPrompt) {

    }


}
